package com.thti.mecool.client.command.result.system;


import android.os.Bundle;
import android.os.Message;

import com.thti.mecool.client.activity.AddCommicationRecordActivity;
import com.thti.mecool.client.command.ICommand;
import com.thti.mecool.client.protocol.system.ProjectResultProtocol;
import com.thti.mecool.client.service.Protocol;

public class GetProjectCommand implements ICommand{

	@Override
	public void doCommand(Object o) {
		ProjectResultProtocol projectResultProtocol=(ProjectResultProtocol)o;
		if (projectResultProtocol != null) {
				if(projectResultProtocol.getStatus()==1){
				Message msg = new Message();
				msg.what=0xBB;
				Bundle bundle = new Bundle();
				bundle.putSerializable("projectresult", projectResultProtocol);
				msg.setData(bundle);
				AddCommicationRecordActivity.handler.sendMessage(msg);				
			}else{
				Message msg = new Message();
				msg.what=0xBC;
				Bundle bundle = new Bundle();
				bundle.putSerializable("msginfo", projectResultProtocol.getMsg());
				msg.setData(bundle);
				AddCommicationRecordActivity.handler.sendMessage(msg);
			}
		}
	}

	@Override
	public String getCommandID() {
		return Protocol.getProject;
	}

	@Override
	public Class<?> getCommandClass() {
		return ProjectResultProtocol.class;
	}

}
